.class public Lcom/hyphenate/chat/a/c;
.super Ljava/lang/Object;


# static fields
.field private static final A:Ljava/lang/String; = "isblocked"

.field private static final B:Ljava/lang/String; = "max_users"

.field private static final C:Ljava/lang/String; = "chatroom"

.field private static final D:Ljava/lang/String; = "name"

.field private static final E:Ljava/lang/String; = "nick"

.field private static final F:Ljava/lang/String; = "desc"

.field private static final G:Ljava/lang/String; = "owner"

.field private static final H:Ljava/lang/String; = "members"

.field private static final I:Ljava/lang/String; = "members_size"

.field private static final J:Ljava/lang/String; = "isblocked"

.field private static final K:Ljava/lang/String; = "max_users"

.field private static final L:Ljava/lang/String; = "unreadcount"

.field private static final M:Ljava/lang/String; = "username"

.field private static final N:Ljava/lang/String; = "count"

.field private static final O:Ljava/lang/String; = "token"

.field private static final P:Ljava/lang/String; = "username"

.field private static final Q:Ljava/lang/String; = "value"

.field private static final R:Ljava/lang/String; = "saved_time"

.field private static final S:Ljava/lang/String; = "contact"

.field private static final T:Ljava/lang/String; = "jid"

.field private static final U:Ljava/lang/String; = "username"

.field private static final V:Ljava/lang/String; = "nick"

.field private static final W:Ljava/lang/String; = "black_list"

.field private static final X:Ljava/lang/String; = "username"

.field private static final Y:Ljava/lang/String; = "conversation_list"

.field private static final Z:Ljava/lang/String; = "username"

.field public static final a:Ljava/lang/String; = "_emmsg.db"

.field private static final aa:Ljava/lang/String; = "groupname"

.field private static final ab:Ljava/lang/String; = "ext"

.field private static final ac:Ljava/lang/String; = "conversation_type"

.field private static final ad:Ljava/lang/String; = "porting"

.field private static final ae:Ljava/lang/String; = "done"

.field private static final af:Ljava/lang/String; = "create table chat (_id integer primary key autoincrement, msgid text, msgtime integer, msgdir integer, isacked integer, isdelivered integer, status integer,participant text not null, islistened integer, msgbody text not null,msgtype integer, groupname text);"

.field private static final ag:Ljava/lang/String; = "create table emgroup (name text primary key, jid text not null, nick text not null, owner text not null, modifiedtime integer, ispublic integer, desc text, members_size integer, isblocked integer, members text, max_users integer);"

.field private static final ah:Ljava/lang/String; = "create table chatroom (name text primary key, nick text, owner text, desc text, members_size integer, isblocked integer, members text, max_users integer);"

.field private static final ai:Ljava/lang/String; = "create table unreadcount (username text primary key, count integer);"

.field private static final aj:Ljava/lang/String; = "create table token (username text primary key, value text, saved_time integer);"

.field private static final ak:Ljava/lang/String; = "create table contact (jid text primary key, username text, nick );"

.field private static final al:Ljava/lang/String; = "create table black_list (username text primary key);"

.field private static final am:Ljava/lang/String; = "create table if not exists conversation_list (username text primary key, groupname text, ext text, conversation_type integer);"

.field private static final an:Ljava/lang/String; = "create table if not exists porting (done integer)"

.field private static ao:Lcom/hyphenate/chat/a/c; = null

.field public static final b:Ljava/lang/String; = "msgbody"

.field public static final c:Ljava/lang/String; = "status"

.field private static d:Ljava/lang/String; = null

.field private static final e:I = 0xd

.field private static final f:Ljava/lang/String; = "chat"

.field private static final g:Ljava/lang/String; = "_id"

.field private static final h:Ljava/lang/String; = "msgid"

.field private static final i:Ljava/lang/String; = "msgtime"

.field private static final j:Ljava/lang/String; = "msgdir"

.field private static final k:Ljava/lang/String; = "participant"

.field private static final l:Ljava/lang/String; = "groupname"

.field private static final m:Ljava/lang/String; = "isacked"

.field private static final n:Ljava/lang/String; = "isdelivered"

.field private static final o:Ljava/lang/String; = "islistened"

.field private static final p:Ljava/lang/String; = "msgtype"

.field private static final q:Ljava/lang/String; = "emgroup"

.field private static final r:Ljava/lang/String; = "name"

.field private static final s:Ljava/lang/String; = "nick"

.field private static final t:Ljava/lang/String; = "desc"

.field private static final u:Ljava/lang/String; = "owner"

.field private static final v:Ljava/lang/String; = "members"

.field private static final w:Ljava/lang/String; = "members_size"

.field private static final x:Ljava/lang/String; = "modifiedtime"

.field private static final y:Ljava/lang/String; = "jid"

.field private static final z:Ljava/lang/String; = "ispublic"


# instance fields
.field private ap:Z

.field private aq:Ljava/lang/String;

.field private ar:Landroid/content/Context;

.field private as:Z

.field private at:Lcom/hyphenate/chat/a/b;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const-string/jumbo v0, "EMDBManager"

    sput-object v0, Lcom/hyphenate/chat/a/c;->d:Ljava/lang/String;

    const/4 v0, 0x0

    sput-object v0, Lcom/hyphenate/chat/a/c;->ao:Lcom/hyphenate/chat/a/c;

    return-void
.end method

.method private constructor <init>()V
    .locals 2

    const/4 v1, 0x0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/hyphenate/chat/a/c;->ap:Z

    iput-object v1, p0, Lcom/hyphenate/chat/a/c;->aq:Ljava/lang/String;

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/hyphenate/chat/a/c;->as:Z

    iput-object v1, p0, Lcom/hyphenate/chat/a/c;->at:Lcom/hyphenate/chat/a/b;

    return-void
.end method

.method static synthetic a(Landroid/database/Cursor;)Lcom/hyphenate/chat/EMMessage;
    .locals 1

    invoke-static {p0}, Lcom/hyphenate/chat/a/c;->d(Landroid/database/Cursor;)Lcom/hyphenate/chat/EMMessage;

    move-result-object v0

    return-object v0
.end method

.method static synthetic a(Lcom/hyphenate/chat/a/c;)Lcom/hyphenate/chat/a/b;
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/a/c;->at:Lcom/hyphenate/chat/a/b;

    return-object v0
.end method

.method public static declared-synchronized a()Lcom/hyphenate/chat/a/c;
    .locals 3

    const-class v1, Lcom/hyphenate/chat/a/c;

    monitor-enter v1

    :try_start_0
    sget-object v0, Lcom/hyphenate/chat/a/c;->ao:Lcom/hyphenate/chat/a/c;

    if-nez v0, :cond_0

    sget-object v0, Lcom/hyphenate/chat/a/c;->d:Ljava/lang/String;

    const-string/jumbo v2, "Please login first!"

    invoke-static {v0, v2}, Lcom/hyphenate/util/EMLog;->e(Ljava/lang/String;Ljava/lang/String;)V

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string/jumbo v2, "Please login first!"

    invoke-direct {v0, v2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :catchall_0
    move-exception v0

    monitor-exit v1

    throw v0

    :cond_0
    :try_start_1
    sget-object v0, Lcom/hyphenate/chat/a/c;->ao:Lcom/hyphenate/chat/a/c;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    monitor-exit v1

    return-object v0
.end method

.method static synthetic a(Ljava/lang/String;ILjava/lang/String;)V
    .locals 0

    invoke-static {p0, p1, p2}, Lcom/hyphenate/chat/a/c;->b(Ljava/lang/String;ILjava/lang/String;)V

    return-void
.end method

.method public static declared-synchronized a(Ljava/lang/String;Lcom/hyphenate/chat/a/b;)V
    .locals 4

    const-class v1, Lcom/hyphenate/chat/a/c;

    monitor-enter v1

    :try_start_0
    sget-object v0, Lcom/hyphenate/chat/a/c;->d:Ljava/lang/String;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "initDB : "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v0, v2}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    sget-object v0, Lcom/hyphenate/chat/a/c;->ao:Lcom/hyphenate/chat/a/c;

    if-eqz v0, :cond_1

    sget-object v0, Lcom/hyphenate/chat/a/c;->ao:Lcom/hyphenate/chat/a/c;

    iget-object v0, v0, Lcom/hyphenate/chat/a/c;->aq:Ljava/lang/String;

    if-eqz v0, :cond_0

    sget-object v0, Lcom/hyphenate/chat/a/c;->ao:Lcom/hyphenate/chat/a/c;

    iget-object v0, v0, Lcom/hyphenate/chat/a/c;->aq:Ljava/lang/String;

    invoke-virtual {v0, p0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v0

    if-eqz v0, :cond_0

    :goto_0
    monitor-exit v1

    return-void

    :cond_0
    :try_start_1
    sget-object v0, Lcom/hyphenate/chat/a/c;->ao:Lcom/hyphenate/chat/a/c;

    invoke-virtual {v0}, Lcom/hyphenate/chat/a/c;->b()V

    :cond_1
    sget-object v0, Lcom/hyphenate/chat/a/c;->ao:Lcom/hyphenate/chat/a/c;

    if-nez v0, :cond_2

    new-instance v0, Lcom/hyphenate/chat/a/c;

    invoke-direct {v0}, Lcom/hyphenate/chat/a/c;-><init>()V

    sput-object v0, Lcom/hyphenate/chat/a/c;->ao:Lcom/hyphenate/chat/a/c;

    sget-object v0, Lcom/hyphenate/chat/a/c;->ao:Lcom/hyphenate/chat/a/c;

    iput-object p1, v0, Lcom/hyphenate/chat/a/c;->at:Lcom/hyphenate/chat/a/b;

    sget-object v0, Lcom/hyphenate/chat/a/c;->ao:Lcom/hyphenate/chat/a/c;

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v2

    invoke-virtual {v2}, Lcom/hyphenate/chat/EMClient;->getContext()Landroid/content/Context;

    move-result-object v2

    iput-object v2, v0, Lcom/hyphenate/chat/a/c;->ar:Landroid/content/Context;

    :cond_2
    sget-object v0, Lcom/hyphenate/chat/a/c;->ao:Lcom/hyphenate/chat/a/c;

    iput-object p0, v0, Lcom/hyphenate/chat/a/c;->aq:Ljava/lang/String;

    sget-object v0, Lcom/hyphenate/chat/a/c;->ao:Lcom/hyphenate/chat/a/c;

    const/4 v2, 0x0

    iput-boolean v2, v0, Lcom/hyphenate/chat/a/c;->ap:Z
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit v1

    throw v0
.end method

.method static synthetic a(Lcom/hyphenate/chat/a/c;Z)Z
    .locals 0

    iput-boolean p1, p0, Lcom/hyphenate/chat/a/c;->as:Z

    return p1
.end method

.method static synthetic b(Landroid/database/Cursor;)V
    .locals 0

    invoke-static {p0}, Lcom/hyphenate/chat/a/c;->e(Landroid/database/Cursor;)V

    return-void
.end method

.method private static b(Ljava/lang/String;ILjava/lang/String;)V
    .locals 1

    sget-object v0, Lcom/hyphenate/chat/a/c;->ao:Lcom/hyphenate/chat/a/c;

    iget-object v0, v0, Lcom/hyphenate/chat/a/c;->at:Lcom/hyphenate/chat/a/b;

    invoke-virtual {v0, p0, p1, p2}, Lcom/hyphenate/chat/a/b;->a(Ljava/lang/String;ILjava/lang/String;)V

    return-void
.end method

.method static synthetic c(Landroid/database/Cursor;)V
    .locals 0

    invoke-static {p0}, Lcom/hyphenate/chat/a/c;->f(Landroid/database/Cursor;)V

    return-void
.end method

.method private static d(Landroid/database/Cursor;)Lcom/hyphenate/chat/EMMessage;
    .locals 6

    const/4 v1, 0x1

    const/4 v2, 0x0

    const-string/jumbo v0, "msgbody"

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/hyphenate/chat/MessageEncoder;->getMsgFromJson(Ljava/lang/String;)Lcom/hyphenate/chat/EMMessage;

    move-result-object v3

    const-string/jumbo v0, "msgid"

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v3, v0}, Lcom/hyphenate/chat/EMMessage;->setMsgId(Ljava/lang/String;)V

    const-string/jumbo v0, "msgtime"

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v4

    invoke-virtual {v3, v4, v5}, Lcom/hyphenate/chat/EMMessage;->setMsgTime(J)V

    const-string/jumbo v0, "msgdir"

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getInt(I)I

    move-result v0

    if-nez v0, :cond_1

    sget-object v0, Lcom/hyphenate/chat/EMMessage$Direct;->SEND:Lcom/hyphenate/chat/EMMessage$Direct;

    :goto_0
    invoke-virtual {v3, v0}, Lcom/hyphenate/chat/EMMessage;->setDirection(Lcom/hyphenate/chat/EMMessage$Direct;)V

    const-string/jumbo v0, "status"

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getInt(I)I

    move-result v0

    sget-object v4, Lcom/hyphenate/chat/EMMessage$Status;->CREATE:Lcom/hyphenate/chat/EMMessage$Status;

    invoke-virtual {v4}, Lcom/hyphenate/chat/EMMessage$Status;->ordinal()I

    move-result v4

    if-ne v0, v4, :cond_2

    sget-object v0, Lcom/hyphenate/chat/EMMessage$Status;->CREATE:Lcom/hyphenate/chat/EMMessage$Status;

    invoke-virtual {v3, v0}, Lcom/hyphenate/chat/EMMessage;->setStatus(Lcom/hyphenate/chat/EMMessage$Status;)V

    :cond_0
    :goto_1
    const-string/jumbo v0, "isacked"

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getInt(I)I

    move-result v0

    if-eqz v0, :cond_5

    move v0, v1

    :goto_2
    invoke-virtual {v3, v0}, Lcom/hyphenate/chat/EMMessage;->setAcked(Z)V

    const-string/jumbo v0, "isdelivered"

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getInt(I)I

    move-result v0

    if-eqz v0, :cond_6

    move v0, v1

    :goto_3
    invoke-virtual {v3, v0}, Lcom/hyphenate/chat/EMMessage;->setDeliverAcked(Z)V

    const-string/jumbo v0, "islistened"

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getInt(I)I

    move-result v0

    if-ne v0, v1, :cond_7

    :goto_4
    invoke-virtual {v3, v1}, Lcom/hyphenate/chat/EMMessage;->setListened(Z)V

    invoke-virtual {v3, v2}, Lcom/hyphenate/chat/EMMessage;->setUnread(Z)V

    const-string/jumbo v0, "groupname"

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    if-nez v0, :cond_8

    sget-object v0, Lcom/hyphenate/chat/EMMessage$ChatType;->Chat:Lcom/hyphenate/chat/EMMessage$ChatType;

    invoke-virtual {v3, v0}, Lcom/hyphenate/chat/EMMessage;->setChatType(Lcom/hyphenate/chat/EMMessage$ChatType;)V

    :goto_5
    return-object v3

    :cond_1
    sget-object v0, Lcom/hyphenate/chat/EMMessage$Direct;->RECEIVE:Lcom/hyphenate/chat/EMMessage$Direct;

    goto :goto_0

    :cond_2
    sget-object v4, Lcom/hyphenate/chat/EMMessage$Status;->INPROGRESS:Lcom/hyphenate/chat/EMMessage$Status;

    invoke-virtual {v4}, Lcom/hyphenate/chat/EMMessage$Status;->ordinal()I

    move-result v4

    if-ne v0, v4, :cond_3

    sget-object v0, Lcom/hyphenate/chat/EMMessage$Status;->INPROGRESS:Lcom/hyphenate/chat/EMMessage$Status;

    invoke-virtual {v3, v0}, Lcom/hyphenate/chat/EMMessage;->setStatus(Lcom/hyphenate/chat/EMMessage$Status;)V

    goto :goto_1

    :cond_3
    sget-object v4, Lcom/hyphenate/chat/EMMessage$Status;->SUCCESS:Lcom/hyphenate/chat/EMMessage$Status;

    invoke-virtual {v4}, Lcom/hyphenate/chat/EMMessage$Status;->ordinal()I

    move-result v4

    if-ne v0, v4, :cond_4

    sget-object v0, Lcom/hyphenate/chat/EMMessage$Status;->SUCCESS:Lcom/hyphenate/chat/EMMessage$Status;

    invoke-virtual {v3, v0}, Lcom/hyphenate/chat/EMMessage;->setStatus(Lcom/hyphenate/chat/EMMessage$Status;)V

    goto :goto_1

    :cond_4
    sget-object v4, Lcom/hyphenate/chat/EMMessage$Status;->FAIL:Lcom/hyphenate/chat/EMMessage$Status;

    invoke-virtual {v4}, Lcom/hyphenate/chat/EMMessage$Status;->ordinal()I

    move-result v4

    if-ne v0, v4, :cond_0

    sget-object v0, Lcom/hyphenate/chat/EMMessage$Status;->FAIL:Lcom/hyphenate/chat/EMMessage$Status;

    invoke-virtual {v3, v0}, Lcom/hyphenate/chat/EMMessage;->setStatus(Lcom/hyphenate/chat/EMMessage$Status;)V

    goto :goto_1

    :cond_5
    move v0, v2

    goto :goto_2

    :cond_6
    move v0, v2

    goto :goto_3

    :cond_7
    move v1, v2

    goto :goto_4

    :cond_8
    const-string/jumbo v1, "msgtype"

    invoke-interface {p0, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {p0, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    sget-object v2, Lcom/hyphenate/chat/EMMessage$ChatType;->GroupChat:Lcom/hyphenate/chat/EMMessage$ChatType;

    invoke-virtual {v3, v2}, Lcom/hyphenate/chat/EMMessage;->setChatType(Lcom/hyphenate/chat/EMMessage$ChatType;)V

    sget-object v2, Lcom/hyphenate/chat/EMMessage$ChatType;->ChatRoom:Lcom/hyphenate/chat/EMMessage$ChatType;

    invoke-virtual {v2}, Lcom/hyphenate/chat/EMMessage$ChatType;->ordinal()I

    move-result v2

    if-ne v1, v2, :cond_9

    sget-object v1, Lcom/hyphenate/chat/EMMessage$ChatType;->ChatRoom:Lcom/hyphenate/chat/EMMessage$ChatType;

    invoke-virtual {v3, v1}, Lcom/hyphenate/chat/EMMessage;->setChatType(Lcom/hyphenate/chat/EMMessage$ChatType;)V

    :cond_9
    invoke-virtual {v3, v0}, Lcom/hyphenate/chat/EMMessage;->setTo(Ljava/lang/String;)V

    goto :goto_5
.end method

.method private static e(Landroid/database/Cursor;)V
    .locals 10

    const/4 v0, 0x1

    const-string/jumbo v1, "name"

    invoke-interface {p0, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {p0, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v1

    const-string/jumbo v2, "ispublic"

    invoke-interface {p0, v2}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v2

    invoke-interface {p0, v2}, Landroid/database/Cursor;->getInt(I)I

    move-result v2

    if-nez v2, :cond_0

    move v2, v0

    :goto_0
    const-string/jumbo v3, "nick"

    invoke-interface {p0, v3}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v3

    invoke-interface {p0, v3}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v4

    const-string/jumbo v3, "owner"

    invoke-interface {p0, v3}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v3

    invoke-interface {p0, v3}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v3

    const-string/jumbo v5, "desc"

    invoke-interface {p0, v5}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v5

    invoke-interface {p0, v5}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v5

    const-string/jumbo v6, "isblocked"

    invoke-interface {p0, v6}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v6

    invoke-interface {p0, v6}, Landroid/database/Cursor;->getInt(I)I

    move-result v6

    if-nez v6, :cond_1

    const/4 v7, 0x0

    :goto_1
    const-string/jumbo v0, "max_users"

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getInt(I)I

    move-result v8

    const-string/jumbo v0, "members"

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    new-instance v9, Ljava/util/StringTokenizer;

    const-string/jumbo v6, ","

    invoke-direct {v9, v0, v6}, Ljava/util/StringTokenizer;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    new-instance v6, Ljava/util/ArrayList;

    invoke-direct {v6}, Ljava/util/ArrayList;-><init>()V

    :goto_2
    invoke-virtual {v9}, Ljava/util/StringTokenizer;->hasMoreTokens()Z

    move-result v0

    if-eqz v0, :cond_2

    invoke-virtual {v9}, Ljava/util/StringTokenizer;->nextToken()Ljava/lang/String;

    move-result-object v0

    invoke-interface {v6, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_2

    :cond_0
    const/4 v2, 0x2

    goto :goto_0

    :cond_1
    move v7, v0

    goto :goto_1

    :cond_2
    sget-object v0, Lcom/hyphenate/chat/a/c;->ao:Lcom/hyphenate/chat/a/c;

    iget-object v0, v0, Lcom/hyphenate/chat/a/c;->at:Lcom/hyphenate/chat/a/b;

    invoke-virtual/range {v0 .. v8}, Lcom/hyphenate/chat/a/b;->a(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;ZI)V

    return-void
.end method

.method static synthetic f()Ljava/lang/String;
    .locals 1

    sget-object v0, Lcom/hyphenate/chat/a/c;->d:Ljava/lang/String;

    return-object v0
.end method

.method private static f(Landroid/database/Cursor;)V
    .locals 8

    const-string/jumbo v0, "name"

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v1

    const-string/jumbo v0, "nick"

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v3

    const-string/jumbo v0, "owner"

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v2

    const-string/jumbo v0, "desc"

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v4

    const-string/jumbo v0, "max_users"

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getInt(I)I

    move-result v6

    const-string/jumbo v0, "members"

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p0, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    new-instance v7, Ljava/util/StringTokenizer;

    const-string/jumbo v5, ","

    invoke-direct {v7, v0, v5}, Ljava/util/StringTokenizer;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    new-instance v5, Ljava/util/ArrayList;

    invoke-direct {v5}, Ljava/util/ArrayList;-><init>()V

    :goto_0
    invoke-virtual {v7}, Ljava/util/StringTokenizer;->hasMoreTokens()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {v7}, Ljava/util/StringTokenizer;->nextToken()Ljava/lang/String;

    move-result-object v0

    invoke-interface {v5, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_0

    :cond_0
    sget-object v0, Lcom/hyphenate/chat/a/c;->ao:Lcom/hyphenate/chat/a/c;

    iget-object v0, v0, Lcom/hyphenate/chat/a/c;->at:Lcom/hyphenate/chat/a/b;

    invoke-virtual/range {v0 .. v6}, Lcom/hyphenate/chat/a/b;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;I)V

    return-void
.end method

.method static synthetic g()V
    .locals 0

    invoke-static {}, Lcom/hyphenate/chat/a/c;->h()V

    return-void
.end method

.method private static h()V
    .locals 1

    sget-object v0, Lcom/hyphenate/chat/a/c;->ao:Lcom/hyphenate/chat/a/c;

    iget-object v0, v0, Lcom/hyphenate/chat/a/c;->at:Lcom/hyphenate/chat/a/b;

    invoke-virtual {v0}, Lcom/hyphenate/chat/a/b;->z()V

    return-void
.end method


# virtual methods
.method public a(Ljava/lang/String;)I
    .locals 5

    const/4 v0, 0x0

    :try_start_0
    iget-object v1, p0, Lcom/hyphenate/chat/a/c;->ar:Landroid/content/Context;

    iget-object v2, p0, Lcom/hyphenate/chat/a/c;->aq:Ljava/lang/String;

    invoke-static {v1, v2}, Lcom/hyphenate/chat/a/c$a;->getInstance(Landroid/content/Context;Ljava/lang/String;)Lcom/hyphenate/chat/a/c$a;

    move-result-object v1

    invoke-virtual {v1}, Lcom/hyphenate/chat/a/c$a;->getReadableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v1

    const-string/jumbo v2, "select count from unreadcount where username = ?"

    const/4 v3, 0x1

    new-array v3, v3, [Ljava/lang/String;

    const/4 v4, 0x0

    aput-object p1, v3, v4

    invoke-virtual {v1, v2, v3}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v2

    invoke-interface {v2}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v1

    if-eqz v1, :cond_1

    const-string/jumbo v1, "count"

    invoke-interface {v2, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v2, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    :goto_0
    invoke-interface {v2}, Landroid/database/Cursor;->close()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    if-gez v1, :cond_0

    :goto_1
    return v0

    :cond_0
    move v0, v1

    goto :goto_1

    :catch_0
    move-exception v1

    goto :goto_1

    :cond_1
    move v1, v0

    goto :goto_0
.end method

.method public a(Ljava/lang/String;Z)J
    .locals 6

    const-wide/16 v0, 0x0

    iget-object v2, p0, Lcom/hyphenate/chat/a/c;->ar:Landroid/content/Context;

    iget-object v3, p0, Lcom/hyphenate/chat/a/c;->aq:Ljava/lang/String;

    invoke-static {v2, v3}, Lcom/hyphenate/chat/a/c$a;->getInstance(Landroid/content/Context;Ljava/lang/String;)Lcom/hyphenate/chat/a/c$a;

    move-result-object v2

    invoke-virtual {v2}, Lcom/hyphenate/chat/a/c$a;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v3

    if-nez p2, :cond_0

    :try_start_0
    const-string/jumbo v2, "participant"

    :goto_0
    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v5, "select count(*) as msgCount from chat where "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string/jumbo v4, " = ?"

    invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    const/4 v4, 0x1

    new-array v4, v4, [Ljava/lang/String;

    const/4 v5, 0x0

    aput-object p1, v4, v5

    invoke-virtual {v3, v2, v4}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v4

    invoke-interface {v4}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v2

    if-nez v2, :cond_1

    invoke-interface {v4}, Landroid/database/Cursor;->close()V

    :goto_1
    return-wide v0

    :cond_0
    const-string/jumbo v2, "groupname"

    goto :goto_0

    :cond_1
    const/4 v2, 0x0

    invoke-interface {v4, v2}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v2

    invoke-interface {v4}, Landroid/database/Cursor;->close()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-wide v0, v2

    goto :goto_1

    :catch_0
    move-exception v2

    invoke-virtual {v2}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_1
.end method

.method public declared-synchronized b()V
    .locals 2

    monitor-enter p0

    :try_start_0
    invoke-static {}, Lcom/hyphenate/chat/a/c$a;->closeDB()V

    sget-object v0, Lcom/hyphenate/chat/a/c;->d:Ljava/lang/String;

    const-string/jumbo v1, "close msg db"

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :goto_0
    monitor-exit p0

    return-void

    :catch_0
    move-exception v0

    :try_start_1
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public c()V
    .locals 2

    iget-object v0, p0, Lcom/hyphenate/chat/a/c;->ar:Landroid/content/Context;

    iget-object v1, p0, Lcom/hyphenate/chat/a/c;->aq:Ljava/lang/String;

    invoke-static {v0, v1}, Lcom/hyphenate/chat/a/c$a;->getInstance(Landroid/content/Context;Ljava/lang/String;)Lcom/hyphenate/chat/a/c$a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/a/c$a;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    sget-object v0, Lcom/hyphenate/chat/a/c;->ao:Lcom/hyphenate/chat/a/c;

    invoke-virtual {v0}, Lcom/hyphenate/chat/a/c;->b()V

    return-void
.end method

.method public d()Ljava/util/List;
    .locals 4

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    :try_start_0
    iget-object v1, p0, Lcom/hyphenate/chat/a/c;->ar:Landroid/content/Context;

    iget-object v2, p0, Lcom/hyphenate/chat/a/c;->aq:Ljava/lang/String;

    invoke-static {v1, v2}, Lcom/hyphenate/chat/a/c$a;->getInstance(Landroid/content/Context;Ljava/lang/String;)Lcom/hyphenate/chat/a/c$a;

    move-result-object v1

    invoke-virtual {v1}, Lcom/hyphenate/chat/a/c$a;->getReadableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v1

    const-string/jumbo v2, "select * from unreadcount"

    const/4 v3, 0x0

    new-array v3, v3, [Ljava/lang/String;

    invoke-virtual {v1, v2, v3}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v1

    invoke-interface {v1}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v2

    if-nez v2, :cond_0

    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    :goto_0
    return-object v0

    :cond_0
    const/4 v2, 0x0

    invoke-interface {v1, v2}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v2

    const/4 v3, 0x1

    invoke-interface {v1, v3}, Landroid/database/Cursor;->getInt(I)I

    move-result v3

    if-lez v3, :cond_1

    invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    :cond_1
    invoke-interface {v1}, Landroid/database/Cursor;->moveToNext()Z

    move-result v2

    if-nez v2, :cond_0

    invoke-interface {v1}, Landroid/database/Cursor;->close()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v1

    goto :goto_0
.end method

.method public e()Z
    .locals 1

    iget-boolean v0, p0, Lcom/hyphenate/chat/a/c;->as:Z

    return v0
.end method
